require.config({
  baseUrl: 'dist/',
  paths: {
    'pinyinTong': '/static/plugins/pinyin/pinyin_dict_withtone',
    'pinyinUtil': '/static/plugins/pinyin/pinyinUtil',

    tslib: '//cdn.bootcss.com/tslib/1.11.1/tslib.min',
    'reflect-metadata': '//cdn.bootcss.com/reflect-metadata/0.1.13/Reflect.min',
    vue: '//cdn.bootcss.com/vue/2.6.11/vue.min',
    axios: '//cdn.bootcss.com/axios/0.19.2/axios.min',
    qs: '//cdn.bootcss.com/qs/6.9.3/qs.min',
    typescript: '//cdn.bootcss.com/typescript/3.7.4/typescript.min',
    moment: '//cdn.bootcss.com/moment.js/2.24.0/moment.min',
    toastr: '//cdn.bootcss.com/toastr.js/2.1.4/toastr.min',
    jquery: '//cdn.bootcss.com/jquery/1.11.3/jquery.min',
    lodash: '//cdn.bootcss.com/lodash.js/4.17.15/lodash.min',
    antd: '//unpkg.com/antd@4.2.2/dist/antd',
    react: '//unpkg.com/react@16.13.1/umd/react.development',
    'react-dom': '//unpkg.com/react-dom@16.13.1/umd/react-dom.development',
    'polyfill': '//cdn.bootcss.com/babel-polyfill/7.8.7/polyfill.min',
    'yvan-ui-antd': '/dist2/yvan-ui-antd/dist/yvan-ui-antd',
    '@ant-design/icons':'/dist2/@ant-design/icons/dist/index.umd'
  },
  map: {
    '*': {
      css: 'https://cdn.bootcss.com/require-css/0.1.10/css.min.js'
    },
  },
  shim: {
    'yvan-ui-antd': {
      deps: [
        'css!//cdn.bootcss.com/font-awesome/5.13.0/css/fontawesome.css',
        'css!//cdn.bootcss.com/font-awesome/5.13.0/css/brands.css',
        'css!//cdn.bootcss.com/font-awesome/5.13.0/css/solid.css',
        // '//cdn.bootcss.com/font-awesome/5.13.0/js/all.min.js',
        // 'css!/dist2/yvan-ui.css'
      ]
    },
    'antd': {
      deps: [
        'css!//unpkg.com/antd@4.2.2/dist/antd.min.css',
        'css!/dist2/yvan-ui-antd/dist/yvan-ui-antd.css'
      ]
    },
    toastr: {
      deps: [
        'css!//cdn.bootcss.com/toastr.js/2.1.4/toastr.min.css'
      ]
    },
  }
});

require(['moment', 'toastr', 'jquery', 'lodash', 'react', 'pinyinTong', 'polyfill'],
  function (moment, toastr, $, _, react) {
    window.moment = moment;
    window.toastr = toastr;
    window.$ = $;
    window._ = _;
    window.React = react;

    // 载入词典完毕之后，再载入 pinyinUtil
    require(['pinyinUtil'], function () {
      window.getFirstPinyin = function (value) {
        return window.pinyinUtil.getFirstLetter(value, true).join('')
      }
    });

    require(['app'])
  }
);